package com.hakim.wfb.biz;

import com.hakim.wfb.bean.BenefitRecord;
import com.hakim.wfb.common.util.DateUtils;
import com.hakim.wfb.dao.BenefitRecordDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * Created by Administrator on 2017/7/1.
 */
@Service("benefitRecordBiz")
public class BenefitRecordBiz {

    @Autowired
    private BenefitRecordDao benefitRecordDao;

    public BenefitRecord getBenefitRecord(String consumeId) {
        BenefitRecord t = new BenefitRecord();

        t.setBrConsumeId(consumeId);
        t.setBrRewardDate(DateUtils.getNextDay(0));
        return benefitRecordDao.getBenefitRecordByDate(t);
    }

    public void add(BenefitRecord benefitRecord) {
        benefitRecordDao.add(benefitRecord);
    }

    public double getTodayStaticProfit(String userId) {
        return benefitRecordDao.getTodayStaticProfit(userId);
    }
}
